//火车票
#include <iostream>
using namespace std;
const int MAXN=100;
int d[MAXN+1];
int l1,l2,l3,c1,c2,c3;
long long minc[MAXN+1][MAXN+1];
int n,s,t;

int main(){
    cin>>l1>>l2>>l3;
    cin>>c1>>c2>>c3;
    cin>>n;
    cin>>s>>t;
    for(int i=2;i<=n;i++) cin>>d[i];
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            minc[i][j]=minc[j][i]=(1000000000LL)*100;
    

    for(int k=1;k<=n-1;k++)
        for(int i=1;i<=n-k;i++){
            int j=i+k;
            int x=d[j]-d[i];
            if (x<=l1) minc[i][j]=minc[j][i]=c1;
            else if (x<=l2) minc[i][j]=minc[j][i]=c2;
            else if (x<=l3) minc[i][j]=minc[j][i]=c3;
            else {
                for(int mid=i+1;mid<j;mid++)
                if (minc[i][j]>minc[i][mid]+minc[mid][j]){
                   minc[i][j]=minc[j][i]=minc[i][mid]+minc[mid][j];
                }
            }        
        }
    cout<<minc[s][t];
}